package sz.szsmk.citizencard.ui.fragment;


import sz.szsmk.citizencard.DaggerApplication;
import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.FragmentCardlistCertificatesBinding;
import sz.szsmk.citizencard.ioc.Compontent.DaggerCommonFragmentComponent;
import sz.szsmk.citizencard.model.network.bean.response.QueryNearStandbyRes;
import sz.szsmk.citizencard.mvp.contract.ICardListCertificatesContact;
import sz.szsmk.citizencard.mvp.presenter.CardsListCertificatesPresenter;
import sz.szsmk.citizencard.ui.adapter.BusSiteNearbyAdapter;
import sz.szsmk.citizencard.ui.base.IBaseFragment;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/11/15 20:27
 * description:
 */
public class CardListCertificatesFragment extends IBaseFragment <CardsListCertificatesPresenter, FragmentCardlistCertificatesBinding>
implements ICardListCertificatesContact.ICardListCertificatesView {


//    private RecyclerView collecSiteRv;
//    private BusSiteNearbyAdapter busSiteNearbyAdapter;

    public static CardListCertificatesFragment getInstance() {
        CardListCertificatesFragment sf = new CardListCertificatesFragment();
        return sf;
    }


    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_cardlist_certificates;
    }

    @Override
    protected void initInjector() {

        DaggerCommonFragmentComponent.builder().appCompontent(DaggerApplication.getAppComponent())
                .build().inject(this);
    }

    @Override
    protected void initViews() {

//        collecSiteRv = dataBinding.collecSiteRv;
//        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
//        dataBinding.collecSiteRv.setLayoutManager(linearLayoutManager);
//        busSiteNearbyAdapter = new BusSiteNearbyAdapter(getActivity());
//        dataBinding.collecSiteRvcollecSiteRv.setAdapter(busSiteNearbyAdapter);
//          dataBinding.swipeRefreshLayout;



//        dataBinding.collecSiteRv.setAdapter(busSiteNearbyAdapter);
//        dataBinding.collecSiteRv.setOnRefreshLoadLister(this);
//        dataBinding.collecSiteRv.startLoadFirst();

//        mPresenter.getDataList("string","string");
    }

    @Override
    protected void updateViews() {

    }

    @Override
    public void getDataListSucc(QueryNearStandbyRes response) {
//        busSiteNearbyAdapter.setViewData(response.getBusSiteList());
//        busSiteNearbyAdapter.notifyDataSetChanged();
//        dataBinding.collecSiteRv.onFinishRequest(false, false);
    }

    @Override
    public void getDataListFail() {

//        dataBinding.collecSiteRv.onFinishRequest(false, false);/
    }


    @Override
    public void onResume() {
        super.onResume();
//        mPresenter.getDataList("string","string");
//        dataBinding.collecSiteRv.startLoadFirst();
    }
}
